//
//  HomeItemsCell.swift
//  TianTianBiTing
//
//  Created by Gox mac 2 on 2018/12/20.
//  Copyright © 2018 Gox_WallyDiao. All rights reserved.
//

import UIKit

class HomeItemsCell: UICollectionViewCell {
    var imageView = UIImageView.init()
    var label = UILabel.init()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
    }
    
    func setUI() {
        
        self.contentView.addSubview(self.imageView)
        self.contentView.addSubview(self.label)
        
        self.imageView.layer.cornerRadius = 22.5
        self.label.font = Font_Medium(11)
        self.label.textAlignment = .center
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
        
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        let contentWidth = self.contentView.bounds.size.width
        
        self.imageView.frame = FRAME_CGFloat(contentWidth / 2 - 22.5, 0, 45, 45)
        self.label.frame = FRAME_CGFloat(0, 55, contentWidth, 15)
    }
    
}
